﻿using Domain.Entity;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EfCore.Configers
{
    public class HFDConfigers : IEntityTypeConfiguration<HFD>
    {
        public void Configure(EntityTypeBuilder<HFD> builder)
        {
            // 指定表名
            builder.ToTable(nameof(HFD));

            // 配置主键
            builder.HasKey(e => e.HfdId);

            // 配置自动增长列
            builder.Property(e => e.HfdId).ValueGeneratedOnAdd();

            // 其他属性配置
            builder.Property(e => e.HumanName).HasMaxLength(100);
            builder.Property(e => e.HumanAddress).HasMaxLength(200);
            builder.Property(e => e.HumanPostcode).HasMaxLength(20);
            builder.Property(e => e.HumanProDesignation).HasMaxLength(50);
            builder.Property(e => e.HumanMajorKindName).HasMaxLength(100);
            builder.Property(e => e.HumanMajorName).HasMaxLength(100); 
            builder.Property(e => e.HumanTelephone).HasMaxLength(20);
            builder.Property(e => e.HumanMobilephone).HasMaxLength(20);
            builder.Property(e => e.HumanBank).HasMaxLength(100);
            builder.Property(e => e.HumanAccount).HasMaxLength(50);
            builder.Property(e => e.HumanQQ).HasMaxLength(20);
            builder.Property(e => e.HumanEmail).HasMaxLength(100);
            builder.Property(e => e.HumanHobby).HasMaxLength(100);
            builder.Property(e => e.HumanSpeciality).HasMaxLength(200);
            builder.Property(e => e.HumanReligion).HasMaxLength(50);
            builder.Property(e => e.HumanParty).HasMaxLength(50);
            builder.Property(e => e.HumanNationality).HasMaxLength(50);
            builder.Property(e => e.HumanRace).HasMaxLength(50);
            builder.Property(e => e.HumanBirthplace).HasMaxLength(100);
            builder.Property(e => e.HumanEducatedDegree).HasMaxLength(50);
            builder.Property(e => e.HumanEducatedMajor).HasMaxLength(100);
            builder.Property(e => e.HumanSocietySecurityId).HasMaxLength(50);
            builder.Property(e => e.HumanIdCard).HasMaxLength(50);
            builder.Property(e => e.Remark).HasMaxLength(500);
            builder.Property(e => e.SalaryStandardName).HasMaxLength(100);
            builder.Property(e => e.HumanHistroyRecords).HasMaxLength(500);
            builder.Property(e => e.HumanFamilyMembership).HasMaxLength(500);
            builder.Property(e => e.AttachmentName).HasMaxLength(100);
            builder.Property(e => e.CheckStatus).HasMaxLength(20);
            builder.Property(e => e.Register).HasMaxLength(50);
            builder.Property(e => e.Checker).HasMaxLength(50);
            builder.Property(e => e.Changer).HasMaxLength(50);
            builder.Property(e => e.HumanFileStatus).HasMaxLength(20);
        }
    }
}
